package com.alibaba.csp.sentinel.dashboard.auth.jwt;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 用途描述： JWT自定义配置
 *
 * @author YangLong
 * @version V1.0
 * @since 2024/2/26
 */
@Component
public class JwtProperties {
    @Value("${jwt.issuer:sentinel_console}")
    private String issuer;

    @Value("${jwt.audience:dashboard}")
    private String audience;

    @Value("${jwt.secret:'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArH7M50usxZ6sODnB243nYRvronC8nvFyyC518Mum6+i+jAQgFKQPWzn7MeVEz4Hrcl5dztBLVhUlSwufLTq4zEur621K9B2pXVKW0NQGjfB6jeqcsJ3RuO3HUYEkBxiar3f1qdWizxWKDlJUJViDq29/5bc+oQnLALyuZG6xAM/O7SQEhTGD6ZQCRNZIKESKkV0Ezh7gePlwKOYglqHv/Zk/HhPS9af7HYRYy3HvoPeZoOOeBFIgEceA93WyRbx/D+XlYotzE/1erAe2uPzjzuf7nKnppYvgYIhTHsBa54O1eCVtowvHeBeSD9g3BhNK3YSWUjUGYyf9gkRCVaz5'}")
    private String secret;

    @Value("${jwt.postOnly:false}")
    private boolean postOnly;

    @Value("${jwt.expireTime:43200000}")
    private long expireTime;


    public String getIssuer() {
        return issuer;
    }

    public void setIssuer(String issuer) {
        this.issuer = issuer;
    }

    public String getAudience() {
        return audience;
    }

    public void setAudience(String audience) {
        this.audience = audience;
    }

    public String getSecret() {
        return secret;
    }

    public void setSecret(String secret) {
        this.secret = secret;
    }

    public boolean isPostOnly() {
        return postOnly;
    }

    public void setPostOnly(boolean postOnly) {
        this.postOnly = postOnly;
    }

    public long getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(long expireTime) {
        this.expireTime = expireTime;
    }
}
